﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.ComponentModel;
using Graphing.Services;

namespace Graphing.ViewModel
{
    class EditPointsViewModel : ViewModelBase
    {
        private ICommand _cancelCommand;
        private IWindowCloseService _closeWindowService = new IWindowCloseService();
        private ThreadingDepositoryService _closeWindowServ = GenericSingleton<ThreadingDepositoryService>.GetInstance();
        public ICommand CancelCommand{
            get
            {
                if (_cancelCommand == null)
                {
                    _cancelCommand = new RelayCommand(param => this.Cancel(), param => this.CanCancel());
                }
                return _cancelCommand;
            }
        }

        private bool CanCancel()
        {
            return true;
        }

        private void Cancel()
        {
            _closeWindowServ.CloseViewThread("EditPointsView");
        }
    }
}
